<script>

function fill(len, direction) {
    if (!len || typeof len !== 'number') {
        return {
            len: 0,
            direction: 'v'
        }
    }
    if (direction === 'h') {
        return {
            len: len,
            direction: 'h'
        };
    } else {
        return {
            len: len,
            direction: 'v'
        };
    }
}

function len(arr) {
    if (!arr) {
        return 0;
    }
    if (typeof arr.length === 'number' && arr.length > 0) {
        return arr.length;
    } else {
        return 0;
    }
}

function handleArray(f, len, direction) {
    var obj = {};
    if (!f || typeof f !== 'number') {
        obj.from = 0;
    } else {
        obj.from = f;
    }
    if (!len || typeof len !== 'number') {
        obj.len = 0;
    } else {
        obj.len = len;
    }
    if (direction && direction === 'h') {
        obj.direction = 'h';
    } else {
        obj.direction = 'v';
    }
    return obj;
}

function concat() {
    var s = "";
    for (var i=0;i<arguments.length;i++){
        s+=arguments[i]
    }
    return s
}


</script>
